package classes.Commands
{
	import components.editor.c_baseElement;
	import components.editor.c_dragRect;
	import components.editor.c_holeyElement;
	
	public class c_holeSelectCommand extends c_linkCommand {
		private var _holeSelectIndex		: int;
		private var _holeSelectPrev			: int;
		private var _holeElement			: c_holeyElement;
		
		public function c_holeSelectCommand(a_holeElement: c_holeyElement, a_holeSelect: int) {
			var hole: Object = a_holeElement.getHole(a_holeElement.curHole);
			
			super(a_holeElement.editor.dragRect, a_holeElement);
			_holeSelectIndex 	= a_holeSelect;
			_holeElement		= a_holeElement;	
		}
		
		override public function Execute():void {
			super.Execute();
			
			_holeSelectPrev = _holeElement.curHole;
			_holeElement.curHole = _holeSelectIndex;
		}
		
		override public function unExecute():void {
			super.unExecute();
			_holeElement.curHole = _holeSelectPrev;
		}
	}
}